<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Posts'); ?></div>
    <h2>Posts</h2>
    <p>Posts are the entries that display in reverse chronological order on your home page. In contrast to pages, posts usually have comments fields beneath them and are included in your site's RSS feed. </p>
    
    <form method="get" id="form" enctype="multipart/form-data">
    <fieldset>
		<legend>Filter</legend>
        <div class="filter-row">
        	<label>Keyword: </label>
            <input type="text" name="q">
        </div>
        <div class="filter-row">
        	<label>Category: </label>
            <select name="cat">
                <option value="">-- select category</option>
                <?php foreach($arrCategories as $R): ?>
                <option value="<?php echo $R['category_id']; ?>" <?php if(isset($arrItemInfo['category_parent']) && $R['category_id'] == $arrItemInfo['category_parent']): ?>selected<?php endif; ?>>
                    <?php for($i=0; $i<$R['category_level']; $i++): echo '&nbsp;&nbsp;&nbsp;'; endfor; ?>
					<?php echo $R['category_name']; ?>
                </option>
                <?php endforeach; ?>
            </select>
        </div>
        <div class="filter-row">
            <label>Created from</label>
            <input tabindex="5" type="text" id="dfrom" name="dfrom" class="datepicker" value="" />
            <span style="float:left; width:22px; text-align:center; margin-top:6px;">To</span> 
            <input tabindex="6" type="text" id="dto" name="dto" class="datepicker" value="" />
        </div>        
        <div style="clear:both; text-align:center">
            <input type="submit" value="Search" /> 
            <input type="reset" name="Clear">
        </div>
    </fieldset>			
    </form>
    <script type="text/javascript">
	$(function() {
		$( ".datepicker" ).datepicker({
			maxDate: "0"
		});
	});
	</script>
    
    <div class="entry">
        <div class="sep"></div>
    </div>
    <table>
        <thead>
            <tr>
            	<th scope="col" class="chb"><input type="checkbox" onclick="selectAll(this);"></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Title');?></th>
                <th scope="col" width="15%"><?php  echo Yii::t('AdmincpModule.admincp', 'Author');?></th>
                <th scope="col" width="15%"><?php  echo Yii::t('AdmincpModule.admincp', 'Categories');?></th>
                <th scope="col" width="15%"><?php  echo Yii::t('AdmincpModule.admincp', 'Date');?></th>
                <th scope="col" width="15%"><?php  echo Yii::t('AdmincpModule.admincp', 'Status');?></th>
                <th scope="col" style="width: 65px;"><?php  echo Yii::t('AdmincpModule.admincp', 'Options');?></th>
            </tr>
        </thead>
            
        <tbody>
        
        <?php if(!empty($arrArticles)):?>
			<?php foreach($arrArticles as $i=>$R):?>
            <tr>
                <td class="align-center"><input type="checkbox" name="id[]" value="<?php echo $R['post_id']; ?>"></td>
                <td>
                	<strong><a href="javascript:void(0);" style="text-decoration:none;"><?php echo $R['post_title']; ?></a></strong>
                    <p style="margin:0; padding: 2px 0 0;">
                        <a href="<?php echo LINK_ADMINCP_ARTICLES.'/form/?id='.$R['post_id']; ?>"  title="Edit">Edit</a> | 
                        <a href="<?php echo LINK_ADMINCP_ARTICLES.'/delete/?id='.$R['post_id']; ?>" title="Delete">Delete</a> 
                    </p>
                </td>
                <td><?php echo $R['post_creator_id']; ?><br><?php echo $R['post_last_modifier_id']; ?></td>
                <td></td>
                <td><?php echo $R['post_created_date']; ?><br><?php echo $R['post_last_modified_date']; ?></td>
                <td><?php echo $R['post_status']; ?></td>
                <td>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/form/?id='.$R['post_id']; ?>" class="table-icon edit" title="Edit"></a>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/view/?id='.$R['post_id']; ?>" class="table-icon archive" title="Archive"></a>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/delete/?id='.$R['post_id']; ?>" class="table-icon delete" title="Delete"></a>
                </td>
            </tr>
            <?php endforeach; ?>
		<?php else: ?>
            <tr>
                <td colspan="7">No data found!</td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
    <div class="entry">
        <?php $this->widget('Pagination', array(
			'pages' => $objPages,
		)) ?>
        <div class="sep"></div>		
        <a class="button add" href="<?php echo LINK_ADMINCP_ARTICLES.'/form'; ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Add Article'); ?></a> <a class="button" href="">Categories</a> 
    </div>
</div>